package com.itheima_03;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class classloaderTest {
    public static void main(String[] args) throws IOException {
        ClassLoader classLoader = classloaderTest.class.getClassLoader();
        InputStream resourceAsStream = classLoader.getResourceAsStream("prop1.properties");

        Properties properties = new Properties();
        properties.load(resourceAsStream);
        String name = properties.getProperty("name");
        String age = properties.getProperty("age");
        String sex = properties.getProperty("sex");
        System.out.println(name);
        System.out.println(age);
        System.out.println(sex);
    }
}
